#!/bin/bash
root_dir=/usr/local/edata
echo "$(date +"%Y-%m-%d %H:%M:%S") INFO uninstall is running..."
echo "$(date +"%Y-%m-%d %H:%M:%S") INFO checking flink mode..."
running_mode=$(cat mode)
echo "$(date +"%Y-%m-%d %H:%M:%S") INFO current mode of flink is $running_mode"

echo "$(date +"%Y-%m-%d %H:%M:%S") INFO remove $root_dir/flink"
rm mode
rm -rf $root_dir/flink
if [[ $? -eq 0 ]];then
  echo "$(date +"%Y-%m-%d %H:%M:%S") INFO flink uninstall success"
else
  echo "$(date +"%Y-%m-%d %H:%M:%S") ERROR flink uninstall error"
fi